import React, { useState, useEffect } from "react";
import PcComparison from "./pcComparison";
import { CSSPrefix, getText } from "./helpers/utils";
import { Spin, Empty ,Table} from "antd";
import { tableColumns } from "./helpers/const";
const data = [{ mainImgUrl:[],mainMobileImgUrl:[],}];
import "./index.scss";
function index(props) {
  const { status, isInMobile, config,dataSource=[] } = props || {};
  const { logParams={}} = config?.render || {};
  console.log(props,'[rrr');
  const renderContent = () => {
    // if (status === "loading") {
    //   return (
    //     <div className="err-block">
    //       <Spin></Spin>
    //     </div>
    //   );
    // }
    // if (status === "error") {
    //   return (
    //     <div className="err-block">
    //       <Empty className="center-block" description={"出错了"}></Empty>
    //     </div>
    //   );
    // }

    // if (!Array.isArray(dataSource) || !dataSource.length) {
    //   return (
    //     <div className="err-block">
    //       <Empty description="暂无数据"></Empty>
    //     </div>
    //   );
    // }

    return (
      <div
        className={`image-wrapper-body ${
          isInMobile ? "image-wrapper-body-mobile" : ""
        }`}
      >
        {/* {isInMobile ? <MobileHeader></MobileHeader> : <PcHeader></PcHeader>} */}
        {/* <PcHeader></PcHeader> */}
        {/* <MobileHeader></MobileHeader> */}
        {/* {dataSource.map((item) => (
          <SingleImgTextBox isInMobile={isInMobile} logParams={logParams}  dataConfig={item}></SingleImgTextBox>
        ))} */}
        <PcComparison dataSource={dataSource}></PcComparison>
      </div>
    );
  };

  return <div className={CSSPrefix}>{renderContent()}</div>;
}

export default index;
